home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Pascal / Applications / NIH Image 1.60 / 1.60 Source / Globals.p < prev    next >
Encoding:
Text File  |  1996-03-08  |  40.7 KB  |  1,239 lines  |  [TEXT/PJMM]

  1. unit Globals;
  2.  
  3. {Global declarations for NIH Image program.}
  4.  
  5.  
  6. interface
  7.  
  8.  
  9. uses
  10.         Types, QuickDraw, Controls, Menus, Dialogs, TextEdit, Palettes, Printing, Files, Components, QDOffscreen;
  11.  
  12. const
  13.         Version = 160;
  14.  
  15.         UsingFPU = false; {If true, select 68881/68882 in Compile Options dialog box.}
  16.  
  17.         AppleMenu = 128;
  18.  
  19.         FileMenu = 129;
  20.         NewItem = 1;
  21.         OpenItem = 2;
  22.         ImportItem = 3;
  23.         CloseItem = 5;
  24.         SaveItem = 6;
  25.         SaveAsItem = 7;
  26.         ExportItem = 8;
  27.         RecordPreferencesItem = 10;
  28.         RevertItem = 11;
  29.         DuplicateItem = 12;
  30.         GetInfoItem = 13;
  31.         AcquireItem = 15;
  32.         PlugInExportItem = 16;
  33.         PageSetupItem = 18;
  34.         PrintItem = 19;
  35.         QuitItem = 21;
  36.  
  37.         AcquireMenu = 42; {Sub Menu}
  38.  
  39.         ExportMenu = 44; {Sub Menu}
  40.  
  41.         EditMenu = 130;
  42.         UndoItem = 1;
  43.         CutItem = 3;
  44.         CopyItem = 4;
  45.         PasteItem = 5;
  46.         ClearItem = 6;
  47.         FillItem = 8;
  48.         InvertItem = 9;
  49.         DrawBoundaryItem = 10;
  50.         DrawScaleItem = 11;
  51.         SelectAllItem = 13;
  52.         DeselectItem = 14;
  53.         ScaleAndRotateItem = 15;
  54.         RotateLeftItem = 17;
  55.         RotateRightItem = 18;
  56.         FlipVerticalItem = 19;
  57.         FlipHorizontalItem = 20;
  58.         UnzoomItem = 22;
  59.         ShowClipboardItem = 23;
  60.  
  61.         OptionsMenu = 131;
  62.         GrayscaleItem = 1;
  63.         ColorTablesItem = 2;
  64.         LutOptionsItem = 3;
  65.         PreferencesItem = 9;
  66.         PlotOptionsItem = 10;
  67.         ScaleToFitItem = 11;
  68.         ThresholdItem = 12;
  69.         SliceItem = 13;
  70.         PropagateItem = 14;
  71.  
  72.         FontMenu = 32; {Sub Menu}
  73.  
  74.         SizeMenu = 33; {Sub Menu}
  75.  
  76.         StyleMenu = 34; {Sub Menu}
  77.         LeftItem = 8;
  78.         CenterItem = 9;
  79.         RightItem = 10;
  80.         NoBackgroundItem = 12;
  81.         WithBackgroundItem = 13;
  82.  
  83.         ColorTablesMenu = 41; {Sub Menu}
  84.         SystemPaletteItem = 1;
  85.         Pseudo20Item = 2;
  86.         Pseudo32Item = 3;
  87.         RainbowItem = 4;
  88.         Fire1Item = 5;
  89.         Fire2Item = 6;
  90.         IceItem = 7;
  91.         GraysItem = 8;
  92.         SpectrumItem = 9;
  93.  
  94.         PropagateMenu = 38;   {Sub Menu}
  95.         LUTItem = 1;
  96.         SpatialItem = 2;
  97.         DensityItem = 3;
  98.         AllItem = 4;
  99.  
  100.         ProcessMenu = 132;
  101.         SmoothItem = 1;
  102.         SharpenItem = 2;
  103.         ShadowItem = 3;
  104.         FindEdgesItem = 4;
  105.         RankItem = 5;
  106.         DitherItem = 6;
  107.         ConvolveItem = 7;
  108.         FilterItem = 8;
  109.         BinaryItem = 10;
  110.         ConstMathItem = 11;
  111.         ImageMathItem = 12;
  112.         fftItem =13;
  113.         BackgroundItem = 14;
  114.         ApplyItem = 15;
  115.         EnhanceItem = 16;
  116.         EqualizeItem = 17;
  117.         FixColorsItem = 18;
  118.  
  119.         FilterMenu = 43; {Sub Menu}
  120.  
  121.         BinaryMenu = 35; {Sub Menu}
  122.         MakeBinaryItem = 1;
  123.         ErosionItem = 3;
  124.         DilationItem = 4;
  125.         OpeningItem = 5;
  126.         ClosingItem = 6;
  127.         SetCountItem = 7;
  128.         IterationsItem = 8;
  129.         OutlineItem = 10;
  130.         SkeletonizeItem = 11;
  131.  
  132.         ArithmeticMenu = 37; {Sub Menu}
  133.         AddItem = 1;
  134.         SubtractItem = 2;
  135.         MultiplyItem = 3;
  136.         DivideItem = 4;
  137.         AndItem2 = 5;
  138.         OrItem2 = 6;
  139.         XorItem2 = 7;
  140.         LogItem = 8;
  141.  
  142.         BackgroundMenu = 40; {Sub Menu}
  143.         HorizontalItem = 1;
  144.         VerticalItem = 2;
  145.         Sub2DItem = 3;
  146.         RemoveStreaksItem = 4;
  147.         FasterItem = 6;
  148.         RadiusItem = 7;
  149.         
  150.         fftMenu = 45;  {Sub Menu}
  151.         ForewardFFTItem = 1;
  152.         InverseFFTItem = 2;
  153.         RedisplayItem = 4;
  154.         SwapItem = 5;
  155.     
  156.         AnalyzeMenu = 133;
  157.         MeasureItem = 1;
  158.         AnalyzeItem = 2;
  159.         ShowItem = 3;
  160.         HistogramItem = 4;
  161.         PlotItem = 5;
  162.         PlotSurfaceItem = 6;
  163.         OptionsItem = 7;
  164.         SetScaleItem = 9;
  165.         CalibrateItem = 10;
  166.         RedoItem = 11;
  167.         DeleteItem = 12;
  168.         ResetItem = 13;
  169.         RestoreItem = 14;
  170.         MarkItem = 15;
  171.  
  172.         SpecialMenu = 140;
  173.         StartItem = 1;
  174.         AverageItem = 2;
  175.         SaveBlankFieldItem = 3;
  176.         VideoControlItem = 4;
  177.         PhotoModeItem = 5;
  178.         LoadMacrosItem = 7;
  179.         FirstMacroItem = 9;
  180.  
  181.         StacksMenu = 141;
  182.         StackFromWindowsItem = 1;
  183.         WindowsFromStackItem = 2;
  184.         AddSliceItem = 3;
  185.         DeleteSliceItem = 4;
  186.         NextSliceItem = 5;
  187.         PreviousSliceItem = 6;
  188.         MakeMovieItem = 8;
  189.         CaptureFramesItem = 9;
  190.         AnimateItem = 10;
  191.         AverageSlicesItem = 11;
  192.         MakeMontageItem = 12;
  193.         CaptureColorItem = 14;
  194.         RGBToColorItem = 15;
  195.         ColorToRGBItem = 16;
  196.         RGBToHSVItem = 17;
  197.         RegisterItem = 19;
  198.         ProjectItem = 20;
  199.         ResliceItem = 21;
  200.         StackInfoItem = 22;
  201.  
  202.         WindowsMenu = 138;
  203.         NextImageItem = 1;
  204.         CascadeImagesItem = 2;
  205.         TileImagesItem = 3;
  206.         PasteControlItem = 4;
  207.         SelectToolsItem = 6;
  208.         SelectGrayMapItem = 7;
  209.         SelectLutItem = 8;
  210.         SelectInfoItem = 9;
  211.         SelectHistogramItem = 10;
  212.         SelectPlotItem = 11;
  213.         SelectResultsItem = 12;
  214.  
  215.         UserMenu = 139;
  216.  
  217.         TransferModeMenu = 200;  {Popup Menu in Paste Control window}
  218.         CopyModeItem = 1;
  219.         AndItem = 2;
  220.         OrItem = 3;
  221.         XorItem = 4;
  222.         ReplaceItem = 5;
  223.         BlendItem = 6;
  224.  
  225.         LineToolMenu = 201;
  226.         StraightItem = 1;
  227.         SegmentedItem = 2;
  228.         FreehandItem = 3;
  229.  
  230.         ImageMathOpsMenu = 202;
  231.         ImageListMenu = 203;
  232.         UnitsMenu = 204;
  233.  
  234.         InvertID = 1;
  235.         HighLightID = 2;
  236.         TriggerID = 3;
  237.         SyncID = 4;
  238.         FirstChannelID = 6;
  239.         OffsetID = 12;
  240.         GainID = 13;
  241.         OffsetUpID = 14;
  242.         OffsetDownID = 15;
  243.         GainUpID = 16;
  244.         GainDownID = 17;
  245.         ResetID = 18;
  246.  
  247.         MinFree = 150000;
  248.         HeaderSize = 512;
  249.         TiffDirSize = 256;
  250.         MaxLine = 4096;
  251.         tleft = 36;
  252.         ttop = 40;
  253.         twidth = 44;
  254.         tmiddle = 22;
  255.         theight = 277;
  256.         gmleft = 2;
  257.         gmtop = 338;
  258.         gmwidth = 78;
  259.         gmheight = 118;
  260.         gmRectLeft = 7;
  261.         gmRectTop = 6;
  262.         gmRectRight = 71;
  263.         gmRectBottom = 70;
  264.         gmSlideWidth = 68;
  265.         gmSlideHeight = 7;
  266.         gmSlide1Offset = 8;
  267.         gmSlide2Offset = 19;
  268.         gmIconWidth = 17;
  269.         gmIconHeight = 14;
  270.         gmIconOffset = 31;
  271.         gmIcon1Left = 17;
  272.         gmIcon2Left = 46;
  273.         cleft = 2;
  274.         ctop = 40;
  275.         cwidth = 30;
  276.         rwidth = 200;
  277.         rheight = 225;
  278.         hleft = 220;
  279.         hwidth = 256;
  280.         hheight = 120;
  281.         pcwidth = 186;
  282.         pcheight = 85;
  283.         MaxPseudoColors = 32;
  284.         MaxPseudoColorsLessOne = 31;
  285.         PicKind = 88;
  286.         HistoKind = 89;
  287.         ProfilePlotKind = 90;
  288.         LUTKind = 91;
  289.         MapKind = 92;
  290.         ToolKind = 93;
  291.         InfoKind = 94;
  292.         CalibrationPlotKind = 95;
  293.         PasteControlKind = 96;
  294.         ResultsKind = 97;
  295.         TextKind = 98;
  296.         IOErrorID = 400;
  297.         AboutID = 256;
  298.         VersItem = 2;
  299.         MemItem = 3;
  300.         StackSize = 40000;
  301.         ToolFont = 249;      {Bits 7-14 of font resource ID(31884) }
  302.         WindowsMenuItems = 13;       {Items in Windows menu before images - nTextWindows}
  303.         WhiteIndex = 0;
  304.         BlackIndex = 255;
  305.         OvalSize = 15;
  306.         LinesLeft = 13;
  307.         LinesRight = 40;
  308.         nLinetypes = 6;
  309.         CheckMarkChar = 65;
  310.         TxPlain = 1;
  311.         TxBold = 2;
  312.         TxItalic = 3;
  313.         TxUnderLine = 4;
  314.         TxOutLine = 5;
  315.         TxShadow = 6;
  316.         FileID8 = 'IPICIMAG';
  317.         DefaultBufferSize = 307200; {Enough for 640x480 image}
  318.         PickerCursorID = 111;
  319.         LUTCursorID = 112;
  320.         gmCursorID = 113;
  321.         GrabberCursorID = 114;
  322.         PencilCursorID = 115;
  323.         CrossCursorID = 117;
  324.         CrossCursorPlusID = 118;
  325.         CrossCursorMinusID = 119;
  326.         BucketCursorID = 120;
  327.         GlassCursorPlusID = 121;
  328.         GlassCursorMinusID = 122;
  329.         WandCursorID = 123;
  330.         WandPlusCursorID = 124;
  331.         WandMinusCursorID = 125;
  332.         TextCursorID = 126;
  333.         EraserCursorID = 127;
  334.         SprayCursorID = 128;
  335.         BrushCursorID = 129;
  336.         FirstAnimatedWatchID = 130;
  337.         FingerCursorID = 137;
  338.         AppleDefaultCLUT = 8;
  339.         SpectrumCLUT = 200;
  340.         KlutzID = 200;
  341.         PixelPaintID = 999; {Used for PixelPaint and Canvas CLUTs}
  342.         GhostWindow = $A84;
  343.         GrayRgnGlobal = $9EE;
  344.         MBarHeight = $BAA;
  345.         MaxPics = 250;
  346.         FirstExtraColorsEntry = 1;
  347.         MaxExtraColors = 6;
  348.         MaxExtraPlus2 = 8;
  349.         ExtraColorsHeight = 10;
  350.         MyMaxLong = 2000000000;
  351.         MaxTextBufSize = 32700;
  352.         MaxMaxRegions = 8000;
  353.         MaxStandards = 20;
  354.         BadReal = 808080.0;
  355.         NoValue = -808080.0;
  356.         TabSpacing = 12;
  357.         MaxPolyVertices = 4000;
  358.         pi = 3.1415926535898;
  359.         InfoVStart = 11;
  360.         InfoHStart = 4;
  361.     {TIFF Constants}
  362.         short = 3;
  363.         long = 4;
  364.         NewSubfileType = 254;
  365.         ImageWidth = 256;
  366.         ImageLength = 257;
  367.         BitsPerSample = 258;
  368.         Compression = 259;
  369.         PhotoInterp = 262;
  370.         StripOffsets = 273;
  371.         SamplesPerPixelTag = 277;
  372.         RowsPerStrip = 278;
  373.         StripByteCount = 279;
  374.         XResolution = 282;
  375.         YResolution = 283;
  376.         PlanarConfigTag = 284;
  377.         ResolutionUnit = 296;
  378.         ColorMapTag = 320;
  379.         ImageHdrTag = -22222; {43314}
  380.         TiffFillerSize = 58;
  381.         RoiHandleSize = 5;
  382.         CancelResetID = 3;
  383.         npcItems = 7;
  384. {Blend = 32;}
  385. {Transparent = 36;}
  386.         LeftArrow = 28;
  387.         RightArrow = 29;
  388.         UpArrow = 30;
  389.         DownArrow = 31;
  390.         hPicOffset = 8;
  391.         vPicOffset = 16;
  392.         FunctionKey = 16;
  393.  
  394.         MaxMacroSize = 18000;
  395.         MaxMacroFileSize = 32767;
  396.         MaxSymbols = 500;
  397.         MaxMacroStackSize = 200;
  398.         MaxMacros = 100;
  399.         SymbolSize = 12;
  400.         BlankSymbol = '            ';
  401.         StackOverflow = 'Stack overflow';
  402.  
  403.         MaxPicSize = 16383;
  404.         ScrollBarWidth = 15;
  405.         PrefsName = 'Image Prefs';
  406.         StraightChar = 97;
  407.         SegmentedChar = 98;
  408.         FreehandChar = 99;
  409.         MaxSlices = 1000;
  410.         HomeKey = 1;
  411.         EndKey = 4;
  412.         PageUp = 11;
  413.         PageDown = 12;
  414.         osEvt = 15;
  415.         Pseudo20ID = 1001;
  416.         Pseudo32ID = 1002;
  417.         RainbowID = 1003;
  418.         Fire1ID = 1004;
  419.         Fire2ID = 1005;
  420.         IceID = 1006;
  421.         GraysID = 1007;
  422.         MaxColor = 15000;
  423.         MaxMaxCoordinates = 25000;
  424.         DefaultDacLow = 60;
  425.         DefaultDacHigh = 185;
  426.         MaxTextWindows = 10;
  427.         maxCoeff = 6;
  428.         maxLabelLength = 9;
  429.         maxTitle = 31;
  430.         maxUnit = 11;
  431.         maxUM = 15;
  432.         maxImageSize = 1000000000; {pixels}
  433.         
  434.  
  435.     type
  436.         LineType = packed array[0..MaxLine] of Byte;
  437.         LinePtr = ^LineType;
  438.         rLineType = array[0..MaxLine] of real;
  439.         rLinePtr = ^rLineType;
  440.         RealLine = array[1..MaxLine] of real;
  441.         ClutTable = packed array[0..255] of integer;
  442.         ColorArray = packed array[0..MaxPseudoColorsLessOne] of byte;
  443.         LutArray = packed array[0..255] of byte;
  444.         PicType = (NewPicture, Normal, PictFile, Leftover, imported, FrameGrabberType, NullPicture, BlankField, TiffFile, FourBitTIFF, PicsFile);
  445.         LUTModeType = (PseudoColor, OldAppleDefault, OldSpectrum, GrayScale, ColorLut, CustomGrayscale);
  446.         ColorTableType = (CustomTable, AppleDefault, Pseudo20, Pseudo32, Rainbow, Fire1, Fire2, Ice, Grays, Spectrum);
  447.         ExtraColorsArray = array[1..MaxExtraColors] of rgbColor;
  448.         MyCSpecArray = array[0..255] of ColorSpec;
  449.         CoefficientArray = array[1..maxCoeff] of extended;
  450.         CurveFitType = (StraightLine, Poly2, Poly3, Poly4, Poly5, ExpoFit, PowerFit, LogFit, RodbardFit, SpareFit1, Uncalibrated, UncalibratedOD);
  451.         UnitsType = (Nanometers, Micrometers, Millimeters, Centimeters, Meters, Kilometers, Inches, Feet, Miles, Pixels, OtherUnits);
  452.         UnitType = string[maxUnit];
  453.         FileDepthType = (EightBits, SixteenBitsUnsigned, SixteenBitsSigned, ThirtyTwoBits);
  454.         RoiTypeType = (PolygonRoi, RectRoi, OvalRoi, LineRoi, FreeLineRoi, SegLineRoi, NoRoi, FreehandRoi, TracedRoi);
  455.         StackTypeType = (VolumeStack, RGBStack, MovieStack, HSVStack);
  456.  
  457.         FakeDouble = array[1..2] of LongInt;
  458.         
  459.         PicHeader = record
  460.                 FileID: packed array[1..8] of char; {8  8}
  461.                 hnlines: integer;                    {2  10}
  462.                 hPixelsPerLine: integer;        {2  12}
  463.                 hversion: integer;                   {2  14}
  464.                 hOldLutMode: LutModeType;    {2  16}
  465.                 hOldnColors: integer;                {2  18}
  466.                 hr, hg, hb: ColorArray;              {96 114}
  467.                 hOldColorStart: integer;             {2  116}
  468.                 hColorWidth: integer;                 {2  118}
  469.                 hExtraColors: ExtraColorsArray;   {36 154}
  470.                 hnExtraColors: integer;              {2  156}
  471.                 hForegroundIndex: integer;     {2  158}
  472.                 hBackgroundIndex: integer;      {2  160}
  473.                 hXScale: FakeDouble;            {8  168}
  474.                 Unused2: integer;                    {2  170}
  475.                 Unused3: integer;                    {2  172}
  476.                 hUnitsID: integer;                   {2  174}
  477.                 hp1x, hp1y, hp2x, hp2y: integer;     {8  182}
  478.                 hfit: CurveFitType;                  {2  184}
  479.                 hnCoefficients: integer;           {2  186}
  480.                 hCoeff: array[1..maxCoeff] of FakeDouble; {48 234}
  481.                 hUM: string[maxUM];              {16 250}
  482.                 UnusedBoolean: boolean;          {1  251}
  483.                 hBinaryPic: boolean;               {1  252}
  484.                 hSliceStart: integer;           {2 254}
  485.                 hSliceEnd: integer;              {2  256}
  486.                 hScaleMagnification: real;   {4  260}
  487.                 hNSlices: integer;             {2 262}
  488.                 hSliceSpacing: real;          {4 266}
  489.                 hCurrentSlice: integer;        {2 268}
  490.                 hFrameInterval: real;          {4  272}
  491.                 hPixelAspectRatio: real;       {4  276}
  492.                 hColorStart: integer;             {2  278}
  493.                 hColorEnd: integer;               {2  280}
  494.                 hnColors: integer;                  {2  282}
  495.                 hFill1, hFill2: RGBColor;    {12  294}
  496.                 hTable: ColorTableType;       {1  295}
  497.                 hLutMode: LutModeType;      {1  296}
  498.                 hInvertedTable: boolean;      {1  297}
  499.                 hZeroClip: boolean;               {1  298}
  500.                 hXUnit: string[maxUnit];            {12 310}
  501.                 hStackType: StackTypeType;     {2  312}
  502.                 UnusedBytes: packed array[1..200] of byte;
  503.             end;
  504.  
  505.         StackInfoRec = record
  506.                 nSlices: integer;
  507.                 CurrentSlice: integer;
  508.                 PicBaseH: array[1..MaxSlices] of handle;
  509.                 SliceSpacing: real; {Pixels}
  510.                 FrameInterval: real; {seconds}
  511.                 StackType: StackTypeType;
  512.             end;
  513.         StackInfoPtr = ^StackInfoRec;
  514.  
  515.         PaletteHeader = record
  516.                 pID: packed array[1..4] of char;  {4  4}
  517.                 pVersion: integer;                              {2  6}
  518.                 pnColors: integer;                              {2  8}
  519.                 pColorStart: integer;                         {2  10}
  520.                 pColorEnd: integer;                            {2  12}
  521.                 pFill1: rgbColor;                               {6  18}
  522.                 pFill2: rgbColor;                               {6  24}
  523.                 pUnused: array[1..4] of integer;     {8  32}
  524.             end;
  525.  
  526.         RoiHeader = record
  527.                 rID: packed array[1..4] of char;  {4   4}
  528.                 rVersion: integer;                              {2   6}
  529.                 rRoiType: RoiTypeType;                    {2   8}
  530.                 rRoiRect: rect;                                   {8   16}
  531.                 rNCoordinates: integer;                     {2   18}
  532.                 rX1, rY1, rX2, rY2: real;                 {16 34}
  533.                 rLineWidth: integer;                          {2   36}
  534.                 rUnused: array[1..14] of integer;    {28 64}
  535.             end;
  536.  
  537.         PicInfo = record
  538.                 iVersion:LongInt;
  539.                 nlines, PixelsPerLine: LongInt;
  540.                 ImageSize: LongInt;
  541.                 BytesPerRow: LongInt;
  542.                 PicBaseAddr: ptr;
  543.                 PicBaseHandle: handle;
  544.                 DataH: handle;
  545.                 StackInfo: StackInfoPtr;
  546.                 osPort: cGrafPtr;         {Offscreen Port}
  547.                 PicRect: rect;
  548.                 RoiRect: rect;
  549.                 roiRgn: rgnHandle;
  550.                 RoiType: RoiTypeType;
  551.                 RoiShowing: boolean;
  552.                 SrcRect: rect;
  553.                 wrect: rect;
  554.                 initwrect: rect;
  555.                 xScale, yScale, zScale: extended;
  556.                 PixelAspectRatio: extended;
  557.                 xUnit: UnitType;  {Someday there may be yUnit}
  558.                 Fit: CurveFitType;
  559.                 nCoefficients: integer;
  560.                 Coefficient: CoefficientArray;
  561.                 ZeroClip: boolean;
  562.                 UnitOfMeasure: string[maxUM];
  563.                 LX1, LY1, LX2, LY2, LAngle: extended;
  564.                 savewrect, SaveSrcRect: rect;
  565.                 SaveMagnification: extended;
  566.                 savehloc, savevloc: integer;  {Old window location in global coordinates}
  567.                 title: string[maxTitle];
  568.                 NewPic: boolean;
  569.                 Magnification: extended;
  570.                 vref: integer;
  571.                 PictureType: PicType;
  572.                 wptr: WindowPtr;
  573.                 PicNum, PidNum: integer;
  574.                 ScaleToFitWindow: boolean;
  575.                 Changes: boolean;
  576.                 RedLUT, GreenLUT, BlueLUT: LutArray;
  577.                 nColors: LongInt;
  578.                 ColorStart, ColorEnd, SaveColorStart, SaveColorEnd: LongInt;
  579.                 FillColor1, FillColor2, SaveFill1, SaveFill2: RGBColor;
  580.                 LUTMode: LUTModeType;
  581.                 ColorTable: ColorTableType;
  582.                 InvertedColorTable: boolean;
  583.                 cTable: MyCSpecArray;
  584.                 IdentityFunction: boolean;
  585.                 PixMapSize: LongInt;
  586.                 HeaderOffset, ImageDataOffset, ColorMapOffset: LongInt;
  587.                 UnusedBoolean, SpatiallyCalibrated: boolean;
  588.                 BinaryPic: boolean;
  589.                 WindowState: (NormalWindow, TiledSmall, TiledSmallScaled, TiledBig, TiledBigScaled);
  590.                 Revertable: boolean;
  591.                 Thresholding: boolean;
  592.                 DataType: FileDepthType;
  593.                 AbsoluteMin, AbsoluteMax, CurrentMin, CurrentMax: LongInt;
  594.                 LittleEndian, InvertedImage: boolean;
  595.                 fileVersion:integer;
  596.             end;
  597.  
  598.         InfoPtr = ^PicInfo;
  599.         ToolType = (MagnifyingGlass, SelectionTool, Grabber, OvalSelectionTool, Pencil, PolygonTool, Eraser, FreehandTool, Brush, LineTool, ruler, LUTTool, PaintBucket, TextTool, PlotTool, SprayCanTool, Wand, PickerTool, AngleTool, CrossHairTool);
  600.         OpType = (InvertOp, PaintOp, FrameOp, EraseOp, PasteOp, AddOp, SubtractOp, MultiplyOp, DivideOp);
  601.         ObjectType = (lineObj, oval, SelectionOval, Rectangle, SelectionRect, BrushObj);
  602.         FilterType = (WeightedAvg, UnweightedAvg, fsharpen, SharpenMore, ShadowN, ShadowNE, ShadowE, ShadowSE, ShadowS, ShadowSW, ShadowW, ShadowNW, {}
  603.             EdgeDetect, FindEdges, ReduceNoise, dither, erosion, dilation, OutlineFilter, skeletonize, MinRankFilter, MaxRankFilter);
  604.         rhptr = ^RgnHandle;
  605.         FlipRotateType = (RotateLeft, RotateRight, FlipVertical, FlipHorizontal);
  606.         TextBackType = (NoBack, WithBack);
  607.         HistogramType = array[0..255] of LongInt;
  608.         str4 = packed array[1..4] of char;
  609.         LookupTable = packed array[0..255] of Byte;
  610.         TextBufType = packed array[1..MaxTextBufSize] of char;
  611.         TextBufPtr = ^TextBufType;
  612.         StandardsArray = array[1..MaxStandards] of extended;
  613.         MeasurementTypes = (AreaM, MeanM, StdDevM, xyLocM, ModeM, LengthM, MajorAxisM, MinorAxisM, AngleM, IntDenM, MinMaxM, User1M, User2M);
  614.         SetOfMeasurements = Set Of MeasurementTYpes;
  615.         TiffHdr = record
  616.                 ByteOrder: packed array[1..2] of char;
  617.                 Version: integer;
  618.                 FirstIFDOffset: LongInt;
  619.             end;
  620.         TiffEntry = record
  621.                 TagField: integer;
  622.                 ftype: integer;
  623.                 length: LongInt;
  624.                 offset: LongInt;
  625.             end;
  626.         pcItemType = (pcPopupMenu, pcCheckBox, pcButton);
  627.         WhatToImportType = (ImportTIFF, ImportMCID, ImportLUT, ImportText, ImportCustom, ImportDICOM);
  628.         FateTable = array[0..255] of integer;
  629.         SaveAsWhatType = (asTIFF, asPICT, asMacPaint, asPICS, AsPalette, AsOutline, AsRawData, SaveAsMCID);
  630.         ExportAsWhatType = (AsRaw, asMCID, asText, AsLUT, asMeasurements, asPlotValues, asHistogramValues, asCoordinates);
  631.  
  632.         RealArray = array[0..MaxMaxRegions] of real;
  633.         meanType = RealArray;
  634.         sdType = RealArray;
  635.         PixelCountType = array[0..MaxMaxRegions] of LongInt;
  636.         AreaType = RealArray;
  637.         modeType = RealArray;
  638.         IntegratedDensityType = RealArray;
  639.         idBackgroundType = RealArray;
  640.         xcenterType = RealArray;
  641.         ycenterType = RealArray;
  642.         MajorAxisType = RealArray;
  643.         MinorAxisType = RealArray;
  644.         orientationType = RealArray;
  645.         MinType = RealArray;
  646.         MaxType = RealArray;
  647.         plengthType = RealArray;
  648.         User1Type = RealArray;
  649.         User2Type = RealArray;
  650.  
  651.         meanPtr = ^meanType;
  652.         sdPtr = ^sdType;
  653.         PixelCountPtr = ^PixelCountType;
  654.         AreaPtr = ^AreaType;
  655.         modePtr = ^modeType;
  656.         IntegratedDensityPtr = ^IntegratedDensityType;
  657.         idBackgroundPtr = ^idBackgroundType;
  658.         xcenterPtr = ^xcenterType;
  659.         ycenterPtr = ^ycenterType;
  660.         MajorAxisPtr = ^MajorAxisType;
  661.         MinorAxisPtr = ^MinorAxisType;
  662.         orientationPtr = ^orientationType;
  663.         MinPtr = ^MinType;
  664.         MaxPtr = ^MaxType;
  665.         plengthPtr = ^plengthType;
  666.         User1Ptr = ^User1Type;
  667.         User2Ptr = ^User2Type;
  668.         SyncModeType = (NormalSync, SeparateSync, SyncOnGreen);
  669.         
  670. {ppc-bug}
  671.         TokenTypeX = (NullT, MacroT, NewLineT, beginT, endT, Identifier, UnknownIdentifier, DoneT, LeftParen,
  672.             RightBracket, comma, colon, SemiColon, StringLiteral, NumericLiteral, VarT, IntegerT, RealT, BooleanT, CommandT,
  673.             FunctionT, ArrayT, AssignOp, ForT, ToT, DoT, IfT, ThenT, ElseT, whileT, repeatT, untilT, Variable, PlusOp,
  674.             MinusOp, MulOp, DivOp, eqOP, ltOp, gtOp, neOp, leOp, geOp, orOp, IntDivOp, modOp, andOp, NotOp, ProcedureT,
  675.             ProcIdT, TrueT, FalseT, RightParen, LeftBracket, StringT, StringVariable,
  676.             StringFunctionT, UserFunctionT, UserFuncIDT);
  677.             
  678.     CommandType = (InvertLUTC, UserCodeC, MoveWindowC, AutoThresholdC, SetExportC, SubtractBackgroundC,
  679.             SetUser1C, SetUser2C, GetPlotDataC, RequiresC, SetOptionsC, GetSpacingC, SetSpacingC,
  680.             PropagateLutC, PropagateDensityC, PropagateSpatialC, SetCountC, ShowMsgC, UpdateLutC, SetCounterC,
  681.             SaveStateC, RestoreStateC, GetTimeC, SetScaleC, MakeLineC, PlotProfileC, ResliceC, CopyModeC,
  682.             TriggerC, AverageFramesC, AddSliceC, DeleteSliceC, MakeStackC, GetSliceC, nSlicesC, SelectSliceC, ChooseSliceC,
  683.             GetMouseC, SetMajorC, SetMinorC, TileC, UpdateResultsC, rCountC, ChangeC, ExportC, PicNumC,
  684.             ScaleSelectionC, ScalingOptionsC, PutPixelC, ChoosePicC, WriteC, WritelnC,
  685.             SetPrecisionC, SetParticleSizeC, AdjustC, IgnoreC,
  686.             OutlineParticlesC, LabelC, IncludeC, AutoC, PlotXYZC, CalibratedC, cValueC, SameSizeC, GetColumnC, PutColumnC,
  687.             GetRowC, PutRowC, ShowResultsC, SetWidthC, ScaleMathC, InvertYC, AndC, OrC, XorC, BlendC, ReplaceC, AddC, SubC,
  688.             MulC, DivC, SetOptionC, GetResultsC, SetLabelsC, SetPlotScaleC, SetDimC, ColumnC, ChannelC, ShowPasteC, NullC,
  689.             RotateRC, RotateLC, FlipVC, FlipHC, CopyC, SelectC, ClearC, FillC, InvertC, FrameC, PasteC, KillC, RestoreC, AnalyzeC,
  690.             ConvolveC, NextC, MarkC, MeasureC, ThresholdC, ResetgmC, MakeBinC, DitherC, SmoothC, SharpenC, ShadowC,
  691.             TraceC, ReduceC, SetSliceC, RedirectC, WaitC, ResetmC, UndoC, SetForeC, SetBackC, ScaleC, HistoC, EnhanceC,
  692.             EqualizeC, ErodeC, DilateC, OutlineC, ThinC, AddConstC, MulConstC, RevertC, BeepC, NopC, MakeC, MakeOvalC,
  693.             MoveC, InsetC, MoveToC, LineToC, DrawTextC, DrawNumC, SetFontC, SetFontSizeC, SetTextC, GetPicSizeC, PutMsgC,
  694.             ExitC, GetRoiC, TruncC, RoundC, GetNumC, StartC, StopC, CaptureC, RandomC, MakeNewC, DrawScaleC, SetPaletteC,
  695.             GetPixelC, ButtonC, oddC, absC, sqrtC, sinC, cosC, expC, lnC, arctanC, sqrC, OpenC, ImportC, SetImportC, SetMinMaxC,
  696.             SetCustomC, nPicsC, SelectPicC, SetPicNameC, ApplyLutC, SetSizeC, SaveC, SaveAllC, SaveAsC, CopyResultsC, CloseC,
  697.             DisposeC, DisposeAllC, DupC, GetInfoC, PrintC, GetLineC, nCoordinatesC, GetStringC,
  698.             OpenSerialC, GetSerialC, PutSerialC, ChrC, OrdC, SetCursorC, TickCountC, ConcatC, SetVideoC, StringToNumC, AcquireC,
  699.             UndoSizeC, CallFilterC, PhotoModeC, RGBToIndexedC, SurfacePlotC, SelectWindowC, NewTextWindowC, CaptureColorC,
  700.             GetThresholdC, AverageSlicesC, BitAndC, BitOrC, PidNumC, SortPaletteC, ProjectC, WindowTitleC, ScaleConvolutionsC,
  701.             ImageMathC, PasteLiveC, PidExistsC, PosC, DeleteC, LengthC, GetScaleC, AutoOutlineC, FilterC, SetSaveAsC,
  702.             CalibrateC, CallExportC, KeyDownC, IndexedToRgbC, MakeMovieC, SetProjectionC, GetHistogramC, GetC, fftC,
  703.             GetPathC, GetFileInfoC, SelectToolC);
  704.  
  705.         ArrayType = (HistogramA, rAreaA, rMeanA, rXA, rYA, rLengthA, rMajorA, rMinA, rMaxA, rUser1A, rUser2A, rMinorA,
  706.             rAngleA, RedLutA, GreenLutA, BlueLutA, rStdDevA, BufferA, PlotDataA, xCoordinatesA, yCoordinatesA, ScionA);
  707.  
  708.         SymbolType = packed array[1..SymbolSize] of char;
  709.         VarType = (IntVar, RealVar, BooleanVar, StringVar);
  710.         SymTabRec = record
  711.                 Symbol: SymbolType;
  712.                 tType: TokenTypeX;
  713.                 cType: CommandType;
  714.                 loc: integer;
  715.             end;
  716.         str255P = ^str255;
  717.         str255H = ^str255P;
  718.         StackRec = record
  719.                 SymbolTableIndex: integer;
  720.                 Value: extended;
  721.                 vType: VarType;
  722.                 StringH: str255H;
  723.             end;
  724.         MacrosRec = record
  725.                 Macros: packed array[0..MaxMacroSize] of char;
  726.                 SymbolTable: array[1..MaxSymbols] of SymTabRec;
  727.                 stack: array[1..MaxMacroStackSize] of StackRec;
  728.                 aLine: LineType;
  729.             end;
  730.         MacrosPtr = ^MacrosRec;
  731.         rsMethodType = (Bilinear, NearestNeighbor);
  732.         TiffColorMapType = array[1..3] of array[0..255] of integer;
  733.         StackIFDType = record
  734.                 nEntries: integer; {2}
  735.                 TiffDir: array[1..6] of TiffEntry; {72}
  736.                 NextIFD: LongInt;  {4}
  737.             end;
  738.         VideoDigitizerStandard = (defaultStd, NTSCStd, PALStd, SECAMStd);
  739.         VideoDigitizerMode = (digitizeGrayscale, digitizeColor, digitizeRGB);
  740.  
  741.         SettingsType = record
  742.                 sID: packed array[1..4] of char;
  743.                 sVersion: integer;
  744.                 sForegroundIndex, sBackgroundIndex: integer;
  745.                 sBrushHeight, sBrushWidth: integer;
  746.                 sSprayCanDiameter: integer;
  747.                 sLUTMode: LUTModeType;
  748.                 sOldColorStart: integer;
  749.                 sOldColorWidth: integer;
  750.                 sCurrentFontID: integer;
  751.                 sCurrentStyle: style;
  752.                 sCurrentSize: integer;
  753.                 sTextJust: integer;
  754.                 sTextBack: TextBackType;
  755.                 snExtraColors: integer;
  756.                 sExtraColors: ExtraColorsArray;
  757.                 sInvertVideo: boolean;
  758.                 sMeasurements: SetOfMeasurements;
  759.                 sInvertPlots, sAutoScalePlots, sLinePlot, sDrawPlotLabels, sFixedSizePlot: boolean;
  760.                 sUnused1: packed array[1..12] of integer;
  761.                 sProfilePlotWidth, sProfilePlotHeight: integer;
  762.                 sFramesToAverage: integer;
  763.                 sNewPicWidth, sNewPicHeight: integer;
  764.                 sBufferSize: LongInt;
  765.                 sUnused3: integer;
  766.                 sThresholdToForeground, sNonThresholdToBackground: boolean;
  767.                 sVideoChannel: integer;
  768.                 sWhatToImport: WhatToImportType;
  769.                 sImportCustomWidth, sImportCustomHeight: integer;
  770.                 sImportCustomOffset: LongInt;
  771.                 sWandAutoMeasure, sWandAdjustAreas: boolean;
  772.                 sBinaryIterations: integer;
  773.                 sScaleArithmetic: boolean;
  774.                 sInvertPixelValues: boolean;
  775.                 sInvertYCoordinates: boolean;
  776.                 sFieldWidth, sPrecision: integer;
  777.                 sMinParticleSize, sMaxParticleSize: LongInt;
  778.                 sIgnoreParticlesTouchingEdge, sLabelParticles, sOutlineParticles, sIncludeHoles: boolean;
  779.                 sKernelsVRefNum: integer;
  780.                 sKernelsDirID: LongInt;
  781.                 sDefaultVRefNum: integer;
  782.                 sDefaultDirID: LongInt;
  783.                 sOscillatingMovies: boolean;
  784.                 sDriverHalftoning: boolean;
  785.                 sMaxMeasurements: integer;
  786.                 sImportCustomDepth: FileDepthType;
  787.                 sImportSwapBytes, sImportCalibrate, sImportAutoscale: boolean;
  788.                 sUnused2: packed array[1..12] of integer;
  789.                 sShowHeadings: boolean;
  790.         {Added with V1.40}
  791.                 sProfilePlotMin, sProfilePlotMax: real;
  792.                 sImportMin, sImportMax: real;
  793.                 sHighlightPixels: boolean;
  794.         {Added with V1.41}
  795.                 sBallRadius: integer;
  796.                 sFasterBackgroundSubtraction: boolean;
  797.                 sScaleConvolutions: boolean;
  798.        {Added with V1.42}
  799.                 sBinaryCount: integer;
  800.                 sColorTable: ColorTableType;
  801.                 sColorStart, sColorEnd: integer;
  802.                 sInvertedTable: boolean;
  803.        {Added with V1.44}
  804.                 sHalftoneFrequency, sHalftoneAngle: integer;
  805.                 sHalftoneDotFunction: boolean;
  806.        {Added with V1.46}
  807.                 sDacLow, sDacHigh: integer;
  808.       {Added with V1.47}
  809.                 sSyncMode: SyncModeType;
  810.       {Added with V1.49}
  811.                 sSwitchLUTOnSuspend: boolean;
  812.                 sVideoRateAveraging: boolean;
  813.       {Added with V1.50}
  814.                 sImportInvert: boolean;
  815.       {Added with V1.52}
  816.                 sTextCreator: packed array[1..4] of char;
  817.       {Added with V1.56}
  818.           sMathSubGain: real;
  819.           sMathSubOffset: LongInt;
  820.       {Added with V1.60}
  821.           sfgScale: integer;
  822.                 sUseBuiltinDigitizer: boolean;
  823.                 sDigitizerMode: VideoDigitizerMode;
  824.                 sDigitizerStandard: VideoDigitizerStandard;
  825.                 sLutFriendlyMode: boolean;
  826.                 sUnused: array[1..10] of LongInt;
  827.             end;
  828.  
  829.         TiffInfoRec = record
  830.                 Width, Height: integer;
  831.                 BitsPerPixel: integer;
  832.                 SamplesPerPixel: integer;
  833.                 PlanarConfig: integer;
  834.                 ZeroIsBlack: boolean;
  835.                 OffsetToData, OffsetToColorMap, OffsetToImageHeader: LongInt;
  836.                 Resolution: extended;
  837.                 ResUnits: (tCentimeters, tInches, tNoUnits);
  838.                 NextIFD: LongInt;
  839.             end;
  840.  
  841.         TiffIFDTable = array[1..MaxSlices] of record
  842.                 iWidth, iHeight: integer;
  843.                 Offset: LongInt;
  844.                 Invert: boolean;
  845.             end;
  846.  
  847.         PaletteRecType = record
  848.                 NumberOfColors: integer;
  849.                 RedData: ColorArray;
  850.                 GreenData: ColorArray;
  851.                 BlueData: ColorArray;
  852.             end;
  853.  
  854.         ProjectionMethodType = (NearestPoint, BrightestPoint, MeanValue);
  855.         AxisType = (XAxis, YAxis, ZAxis);
  856.         FiducialMethodType = (OnScreen, FromFile);
  857.  
  858.         CoordinatesType = array[1..MaxMaxCoordinates] of integer;
  859.         xCoordinatesPtr = ^CoordinatesType;
  860.         yCoordinatesPtr = ^CoordinatesType;
  861.         WhatToUndoType = (NothingToUndo, UndoEdit, UndoFlip, UndoRotate, UndoFilter, UndoPaste, UndoTransform, UndoClear, UndoMeasurement, UndoPoint, UndoZoom, UndoOutline, UndoSliceDelete, UndoFirstSliceDelete, UndoLUT);
  862.  
  863.         TextInfoRec = record
  864.                 TextWindowPtr: WindowPtr;
  865.                 TextLeft, TextTop, TextWidth, TextHeight: integer;
  866.                 hTextScrollBar, vTextScrollBar: ControlHandle;
  867.                 hTextPageSize, vTextPageSize: integer;
  868.                 TextTE: TEHandle;
  869.                 TextTitle: str255;
  870.                 TextRefNum: integer;
  871.                 Changes, TooBig: boolean;
  872.                 WindowNum: integer;
  873.             end;
  874.         TextInfoPtr = ^TextInfoRec;
  875.  
  876.         ImageData = packed array[0..maxImageSize] of byte;
  877.         ImageP = ^ImageData;
  878.         
  879.         rImageData = packed array[0..maxImageSize] of real;
  880.         rImagePtr = ^rImageData;
  881.  
  882.         eType=(e1,e2,e3);
  883.         uPtr=^byte; {pointer to unsigned bytes}
  884.         fftType = (ForewardFFT, InverseFFT, InverseFFTWithMask, InverseFFTWithFilter);
  885.         
  886.     var
  887.         TraceInfo: str4;
  888.         finished: boolean;
  889.         trect, gmrect, MapRect1, MapRect2, crect, HistoRect: rect;
  890.         gmSlide1, gmslide2, gmSlide1i, gmSlide2i, gmicon1, gmicon2: rect;
  891.         ToolWindow, MapWindow, LUTWindow, InfoWindow, HistoWindow, PlotWindow, PasteControl: WindowPtr;
  892.         BuggyWatch: CursHandle;
  893.         cr, tab, BackSpace, eofChr: char;
  894.         crStr:string[1]; {ppc-bug}
  895.         CharCount: LongInt;
  896.         ScreenPort: GrafPtr;
  897.         CScreenPort: cGrafPtr;
  898.         ipTicks:LongInt;
  899.         MonoFunction: ClutTable;
  900.         Info: InfoPtr;
  901.         ToolCursor: array[ToolType] of Cursor;
  902.         AnimatedWatch: array[1..8] of Cursor;
  903.         WatchIndex: integer;
  904.         PickerCursor, LUTCursor, gmCursor, CrossPlusCursor, CrossMinusCursor, GlassMinusCursor, watch, WandPlusCursor, WandMinusCursor, FingerCursor: Cursor;
  905.         CurrentTool, PreviousTool, FirstTool, LastTool: ToolType;
  906.         ToolRect: array[ToolType] of rect;
  907.         ToolTime, LutTime: longInt;
  908.         nPics, nextPid: integer;
  909.         PicWindow: array[1..MaxPics] of WindowPtr;
  910.         ScreenWidth, ScreenHeight: integer;
  911.         ScreenBase: ptr;
  912.         ScreenRowBytes: LongInt;
  913.         ScreenPixMap: PixMapHandle;
  914.         Histogram: HistogramType;
  915.         HistogramSliceStart, HistogramSliceEnd: integer;
  916.         ForegroundIndex, BackgroundIndex: integer;
  917.         lines: array[1..nLineTypes] of rect;
  918.         CheckRect: rect;
  919.         LineWidth, LineIndex: integer;
  920.         StartOfLines: integer;
  921.         MaskRgn: RgnHandle;
  922.         PlotPICT: PicHandle;
  923.         PlotLeft, PlotTop, PlotWidth, PlotHeight, PlotPicNum: integer;
  924.         PlotMin, PlotMax, ActualPlotMin, ActualPlotMax: extended;
  925.         PlotCount, PlotAvg: integer;
  926.         PlotData: rLinePtr;
  927.         PlotAngle, PlotScale: extended;
  928.         PlotStart: point;
  929.         PlotXUnits, PlotYUnits: string[MaxUM];
  930.         InvertPlots, AutoscalePlots, LinePlot, DrawPlotLabels, FixedSizePlot: boolean;
  931.         ProfilePlotMin, ProfilePlotMax: extended;
  932.         ProfilePlotWidth, ProfilePlotHeight: integer;
  933.         UndoBuf, ClipBuf, BigBuf: ptr;
  934.         ClipBufSize, UndoBufSize, BigBufSize: LongInt;
  935.         UndoInfoRec: PicInfo;
  936.         UndoInfo: InfoPtr;
  937.         CurrentUndoSize: LongInt;
  938.         SprayCanDiameter, SprayCanRadius, SprayCanRadius2: integer;
  939.         BrushHeight, BrushWidth: integer;
  940.         CurrentFontID, CurrentSize, NumFontItems: integer;
  941.         CurrentStyle: Style;
  942.         InsertionPoint: point; {Offscreen coordinates}
  943.         IsInsertionPoint: boolean;
  944.         TextJust: integer;
  945.         TextBack: TextBackType;
  946.         TextStr: str255;
  947.         TextRect: rect;
  948.         TextStart: point;
  949.         BlinkTime: LongInt;
  950.         AntPattern: array[0..7] of pattern;
  951.         PatIndex: integer;
  952.         OpPending: boolean;
  953.         CurrentOp: OpType;
  954.         IsOK: boolean;
  955.         PicLeftBase, PicTopBase, PicLeft, PicTop: integer;
  956.         ClipBufInfoRec: PicInfo;
  957.         ClipBufInfo: InfoPtr;
  958.         MouseState: (NotInRoi, InRoi, DownInRoi);
  959.         osMouseDownLoc: point;
  960.         OldRoiRect: rect;
  961.         WhatsOnClip: (NothingOnClip, AColor, RectPic, NonRectPic, ImportedPic, CameraPic, TextOnClip, LivePic);
  962.         ClipTextInBuffer: boolean;
  963.         ExtraColors: ExtraColorsArray;
  964.         nExtraColors: integer;
  965.         PasteTransferMode: integer;
  966.         cheight: integer;
  967.         ExtraColorsRect: array[1..MaxExtraPlus2] of rect;
  968.         ExtraColorsEntry: array[1..MaxExtraPlus2] of integer;
  969.         RoiMode: (MoveMode, StretchMode, LeftEndMode, RightEndMode);
  970.         OldScrapCount: integer;
  971.         ClipboardConverted: boolean;
  972.         results: record
  973.                 UncalibratedMean: extended;
  974.                 MinIndex, MaxIndex, imode: integer;
  975.             end;
  976.         FrameGrabber: (QuickCapture, ScionLG3, ScionAG5, ScionVG5f, QTvdig, NoFrameGrabber);
  977.         fgSlotBase, fgRowBytes: LongInt;
  978.         ControlReg, ChannelReg, BufferReg, DacHighReg, DacLowReg: ptr;
  979.         Digitizing: boolean;
  980.         debugging: boolean;
  981.         NoInfo: InfoPtr;
  982.         NoInfoRec: PicInfo;
  983.         UndoFromClip: boolean;
  984.         DensitySlicing, ThresholdToForeground, NonThresholdToBackground: boolean;
  985.         SliceStart, SliceEnd: integer;
  986.         SliceColor: RGBColor;
  987.         BlankFieldInfo: InfoPtr;
  988.         BlankFieldMean: integer;
  989.         InvertVideo, HighlightSaturatedPixels: boolean;
  990.         VideoChannel: integer;
  991.         TextBufSize, TextBufColumn: integer;
  992.         TextBufLineCount: LongInt;
  993.         TextBufP: TextBufPtr;
  994.         BitInfoCount: integer;
  995.         mCount, mCount2: integer;
  996.         nPoints, nLengths, nAngles: integer;
  997.         umean: array[0..MaxStandards] of extended; {Uncalibrated means}
  998.         StandardValues: StandardsArray;
  999.         nStandards, nKnownValues: integer;
  1000.         cvalue: array[0..255] of extended;
  1001.         minCValue, maxCValue, FitGoodness, FitSD: extended;
  1002.         PlotLeftMargin, PlotTopMargin, PlotBottomMargin, PlotRightMargin: integer;
  1003.         WhatToUndo: WhatToUndoType;
  1004.         WhatToCopy: (NothingToCopy, CopySelection, CopyCLUT, CopyGrayMap, CopyTools, CopyPlot, CopyCalibrationPlot, CopyHistogram, CopyMeasurements, CopyColor, CopyText);
  1005.         WhatToPrint: (NothingToPrint, PrintImage, PrintSelection, PrintMeasurements, PrintPlot, PrintHistogram, PrintText);
  1006.         PrintRecord: THPrint;
  1007.         isLaserWriter: boolean;
  1008.         printing: boolean;
  1009.         HalftoneFrequency, HalftoneAngle: integer;
  1010.         HalftoneDotFunction: boolean;
  1011.         AppleMenuH, FileMenuH, AcquireMenuH, ExportMenuH, EditMenuH, OptionsMenuH, ColorTablesMenuH, {}
  1012.         PropagateMenuH, ProcessMenuH, FilterMenuH, BinaryMenuH, ArithmeticMenuH, BackgroundMenuH, {}
  1013.         AnalyzeMenuH, SpecialMenuH, StacksMenuH, SortPaletteMenuH, FontMenuH, SizeMenuH, StyleMenuH, {}
  1014.         WindowsMenuH, UserMenuH, TransferModeMenuH, LineToolMenuH, ImageMathOpsMenuH, ImageListMenuH, {}
  1015.         UnitsMenuH, fftMenuH: MenuHandle;
  1016.         rleft, rtop: integer;
  1017.         ListDone: boolean;
  1018.         ResultsWindow: WindowPtr;
  1019.         hScrollBar, vScrollBar: ControlHandle;
  1020.         ListTE: TEHandle;
  1021.         hListPageSize, vListPageSize: integer;
  1022.         measuring: boolean;
  1023.         Measurements: SetOfMeasurements;
  1024.         nListColumns: integer;
  1025.         FramesToAverage: LongInt;
  1026.         xLabel, yLabel, zLabel: string[31];
  1027.         xValueLoc, yValueLoc, zValueLoc: integer;
  1028.         MenuBarHeight: integer;
  1029.         NewPicWidth, NewPicHeight: LongInt;
  1030.         RestoreUndoBuf: boolean;
  1031.         WhatToOpen: (OpenImage, OpenPICT2, OpenTIFF, OpenMCID, OpenUnknown, OpenImported, OpenCustom);
  1032.         WhatToImport: WhatToImportType;
  1033.         ImportCustomWidth, ImportCustomHeight, ImportCustomSlices: LongInt;
  1034.         ImportCustomOffset: LongInt;
  1035.         ImportCustomDepth: FileDepthType;
  1036.         ImportSwapBytes, ImportAll, ImportCalibrate, ImportInvert: boolean;
  1037.         IntelByteOrder: boolean;
  1038.         BufferSize: LongInt;
  1039.         isSelectionTool: boolean;
  1040.         SelectionMode: (NewSelection, AddSelection, SubSelection);
  1041.         RoiMovementState: (Unconstrained, Constrained, ConstrainedH, ConstrainedV);
  1042.         pcItem: array[1..npcItems] of record
  1043.                 r: rect;
  1044.                 itype: pcItemType;
  1045.                 str: string[20];
  1046.             end;
  1047.         PictF: integer;
  1048.         PictBuffer, curPictBufPtr: ptr;
  1049.         BytesInPictBuffer: LongInt;
  1050.         FitsInPictBuffer, RoiNudged, GrayMapReady, RedoSelection: boolean;
  1051.         ThresholdingMode: (DensitySlice, GrayMapThresholding, BinaryImage, NoThresholding);
  1052.         WandAutoMeasure, WandAdjustAreas, RedirectSampling: boolean;
  1053.         LabelParticles, OutlineParticles, IgnoreParticlesTouchingEdge, IncludeHoles: boolean;
  1054.         MinParticleSize, MaxParticleSize: LongInt;
  1055.         OptionKeyWasDown, ScaleArithmetic, FitEllipse, AnalyzingParticles: boolean;
  1056.         WhiteRGB, BlackRGB: RGBColor;
  1057.         BinaryIterations: integer;
  1058.         nMonitors: integer;
  1059.         Monitors: array[1..6] of GDHandle;
  1060.         InfoMessage: str255;
  1061.         fgStartTicks, fgFrameCount: LongInt;
  1062.         SaveAsWhat: SaveAsWhatType;
  1063.         ExportAsWhat: ExportAsWhatType;
  1064.         SaveAllState: (NoSaveAll, SaveAllStage1, SaveAllStage2);
  1065.         InvertPixelValues, InvertYCoordinates, ContinuousHistogram: boolean;
  1066.         fgPort: cGrafPtr;
  1067.         fgPixMap: PixMapHandle;
  1068.         fgWidth, fgHeight, fgScale: integer;
  1069.         RoiUpdateTime: LongInt; {Time required to draw ROI outline. Set to 0 to force redraw.}
  1070.         FieldWidth: integer;
  1071.         Precision: integer; {Digits to right of decimal point}
  1072.         MeasurementToRedo: integer;
  1073.         Has32BitQuickDraw: boolean;
  1074.         DefaultRefNum, KernelsRefNum, MacrosRefNum: integer;
  1075.         LaunchVRefNum, PlugInsVRefNum: integer;
  1076.         LaunchDirID, PlugInsDirID: LongInt;
  1077.         DefaultFileName: string[63];
  1078.         rsHScale, rsVScale, rsAngle: extended; {Rotate and Scale Parameters}
  1079.         rsMethod: rsMethodType;
  1080.         rsCreateNewWindow: boolean;
  1081.         rsInteractive: boolean;
  1082.         TextEol, TextEof: boolean;
  1083.         Textf, TextIndex: integer;
  1084.         TextFileSize: LongInt;
  1085.         nMacros, nSymbols: integer;
  1086.         pcStart, TopOfStack, CurrentX, CurrentY, EndMacros: integer;
  1087.         nProcedures, TokenLoc, TokenStackLoc, SavePC, nGlobals, SymbolTableLoc: integer;
  1088.         LegalWithoutImage: set of CommandType;
  1089.         SaveForeground: integer;
  1090.         PC: integer; {"program counter" used by macro interpreter}
  1091.         MacroLineNumber: integer;
  1092.         MacroStart: array[1..MaxMacros] of integer;
  1093.         MacroKey: packed array[1..MaxMacros] of char;
  1094.         Token, SaveToken:TokenTypeX;
  1095.         TokenStr: str255;
  1096.         TokenSymbol, MacroOrProcName: SymbolType;
  1097.         TokenValue: extended;
  1098.         Macro: boolean; {True if macro is running.}
  1099.         MacrosP: MacrosPtr;
  1100.         MacroCommand: CommandType;
  1101.         SerialIn, SerialOut: integer;
  1102.         SerialBufferP: ptr;
  1103.         ImportAutoScale: boolean;
  1104.         ImportMin, ImportMax: extended;
  1105.         OscillatingMovies, DriverHalftoning: boolean;
  1106.         ExplicitPalette: PaletteHandle;
  1107.         LivePasteMode: boolean;
  1108.         ShowCount: boolean;
  1109.         PasteControlLeft, PasteControlTop: integer;
  1110.         MaxMeasurements, MaxCoordinates: integer;
  1111.         mean: meanPtr;
  1112.         sd: sdPtr;
  1113.         PixelCount: PixelCountPtr;
  1114.         mArea: AreaPtr;
  1115.         mode: modePtr;
  1116.         IntegratedDensity: IntegratedDensityPtr;
  1117.         idBackground: idBackgroundPtr;
  1118.         xcenter: xcenterPtr;
  1119.         ycenter: ycenterPtr;
  1120.         MajorAxis: MajorAxisPtr;
  1121.         MinorAxis: MinorAxisPtr;
  1122.         orientation: orientationPtr;
  1123.         mMin: MinPtr;
  1124.         mMax: MaxPtr;
  1125.         plength: plengthPtr;
  1126.         User1: User1Ptr;
  1127.         User2: User2Ptr;
  1128.         ResultsLeft, ResultsTop, ResultsWidth, ResultsHeight: integer;
  1129.         UnsavedResults: boolean;
  1130.         MajorLabel, MinorLabel, User1Label, User2Label: string[maxLabelLength];
  1131.         OldSystem, System7: boolean;
  1132.         SystemRefNum: integer;
  1133.         ShowHeadings: boolean;
  1134.         MakingLOI: boolean;
  1135.         LOIType: (Straight, Freehand, Segmented);
  1136.         MakingStack: boolean;
  1137.         FramesWanted: integer;
  1138.         ScaleConvolutions: boolean;
  1139.         FasterBackgroundSubtraction: boolean;
  1140.         BallRadius: integer;
  1141.         DelayTicks: integer;
  1142.         CmdPeriodToStop: string[21];
  1143.         CommandKey: char;
  1144.         BinaryCount, BinaryThreshold: integer;
  1145.         ClipboardColor: rgbColor;
  1146.         InitAngle, TotalAngle, AngleInc,                 {initial, total, and incremental angles of volume rotation}
  1147.         TransparencyLower,                                   {pixels below this threshold are transparent}
  1148.         TransparencyUpper,                                   {pixels above this threshold are transparent}
  1149.         Opacity,                                                       {percentage nearest-point in a combined projection}
  1150.         DepthCueSurf,                                             {depth-cueing constant for nearest-pt component}
  1151.         DepthCueInt: integer;                                  {depth-cueing constant for other projection components}
  1152.         AxisOfRotation: AxisType;                           {project volume as it rotates about x,y,or z-axis}
  1153.         SaveProjections,                                         {if TRUE, save and close proj frames once created}
  1154.         MinProjSize: boolean;                                {if FALSE, make windows same size regardless of rotation axis}
  1155.         ProjectionMethod: ProjectionMethodType;
  1156.         MeterWindow: WindowPtr;
  1157.         xCoordinates: xCoordinatesPtr;
  1158.         yCoordinates: yCoordinatesPtr;
  1159.         nCoordinates: integer;
  1160.         CoordinatesWidth, CoordinatesHeight: integer;
  1161.         CoordinatesRoiType: RoiTypeType;
  1162.         SwitchLUTOnSuspend: boolean;
  1163.         SumFrames, ExternalTrigger, BlindMovieCapture, ShowIntegratedValues, FixIntegrationScale: boolean;
  1164.         IntegrationMin, IntegrationMax: LongInt;
  1165.         DacHigh, DacLow: integer;
  1166.         MaxLG3Frames: integer;
  1167.         VideoRateAveraging: boolean;
  1168.         VideoControl: DialogPtr;
  1169.         ConstantReg: ptr;
  1170.         ScaleHighReg, ScaleLowReg: IntegerPtr;
  1171.         AG5LutMode: boolean;
  1172.         AG5GrabMode: (GrabNormal, GrabSum, GrabDivide, GrabScale);
  1173.         AG5BufferMode: (Read0Lut0Grab0, Read1Lut0Grab0, Read2Lut0Grab0, Read3Lut0Grab0, Read0Lut1Grab0, Read1Lut1Grab0, Read2Lut1Grab0, Read3Lut1Grab0,{}
  1174.             Read0Lut0Grab1, Read1Lut0Grab1, Read2Lut0Grab1, Read3Lut0Grab1, Read0Lut1Grab1, Read1Lut1Grab1, Read2Lut1Grab1, Read3Lut1Grab1);
  1175.         SyncMode: SyncModeType;
  1176.         DitherColor: boolean;
  1177.         RGBLut: (ExistingLUT, SystemLUT, CustomLUT);
  1178.         Highlight1, Highlight254: rgbColor;
  1179.         HighlightMode: boolean;
  1180.         OpeningPlugInWindow: boolean;
  1181.         DacAReg, DacBReg: ptr;
  1182.         LG3DacA, LG3DacB, LG3DataOut: integer;
  1183.         nAcqPlugIns, nExportPlugIns, nFilterPlugIns: integer;
  1184.         LastAcqPlugIn, LastFilterPlugIn, LastExportPlugIn, NewTitle: string[31];
  1185.         TextInfo: TextInfoPtr;
  1186.         nTextWindows: integer;
  1187.         TextWindow: array[1..MaxTextWindows] of WindowPtr;
  1188.         SearchString: string[31];
  1189.         CurrentWPtr: WindowPtr;
  1190.         CurrentKind: integer;
  1191.         ToolBits: BitMap;
  1192.         TextCreator: packed array[1..4] of char;
  1193.         CurrentMathOp: (AddMath, SubMath, MulMath, DivMath, AndMath, OrMath, XorMath, MaxMath, MinMath, cMulMath, CopyMath);
  1194.         MathSrc1, MathSrc2: integer;
  1195.         MathGain, MathSubGain: extended;
  1196.         MathOffset, MathSubOffset: extended;
  1197.         MathResult: string[31];
  1198.         APReset: boolean;
  1199.         ShowPlot: boolean;
  1200.         osGDevice: GDHandle;
  1201.         gCopyMode: integer;
  1202.         SaveScreenDepth: integer;
  1203.         FiducialMethod: FiducialMethodType;
  1204.         ConfirmFidClicks: boolean;
  1205.         WireframeSurfacePlots, GrayscaleSurfacePlots: boolean;
  1206.         RankFilter: (MedianRank, MinRank, MaxRank, OpeningRank, ClosingRank);
  1207.         RankIterations: integer;eVar:eType;
  1208.         TextScrollActionProc:UniversalProcPtr;{ControlActionUPP} {ppc-bug}
  1209.         AboutBoxFilterProc, AboutBoxUserProc, ResultsScrollActionProc, ImageMathUserProc, SetScaleUserProc:UniversalProcPtr;
  1210.         OpenDHookProc, SaveAsDHookProc, ImportDHookProc, ExportDHookProc:UniversalProcPtr;
  1211.         BitInfoProc, GetPictDataProc:UniversalProcPtr;
  1212.         TestAbortProc, UpdateProgressProc:UniversalProcPtr;
  1213.         IntegrateOnChip: boolean;
  1214.         OpeningFinderFiles:boolean;
  1215.         gNumberSlices, gBorders: boolean;
  1216.         RealImageMath:boolean;
  1217.         StartupSpec: FSSpec;
  1218.         DicomInitialized, ImportingDicom:boolean;
  1219.         OpeningRGB: boolean;
  1220.         superSlotBase: LongInt; {address of frame buffer using 32-bit addressing}
  1221.         PrecisionTiming, TimeStamp, LG3BufferCapture: boolean;
  1222.         SecondsPerFrame: extended;
  1223.         TriggerFirstFrameOnly: boolean;
  1224.         UseExistingStack: boolean;
  1225.         RealArithmetic: boolean;
  1226.         vdig: ComponentInstance;
  1227.         GWorldLUT: CTabHandle;
  1228.         osGWorld: GWorldPtr;
  1229.         UseBuiltinDigitizer: boolean;
  1230.         DigitizerMode: VideoDigitizerMode;
  1231.         DigitizerStandard: VideoDigitizerStandard;
  1232.         fgSuperSlotBase0, fgSuperSlotBase1: LongInt;
  1233.         PCIFrameGrabber, DoubleBuffering, CurrentBufferIsZero: boolean;
  1234.         LUTFriendlyMode: boolean;
  1235.     
  1236.  
  1237. implementation
  1238.  
  1239. end.